home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5305 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  4.3 KB

  1. Path: mail2news.demon.co.uk!wildcard.demon.co.uk
  2. From: Cyber Surfer <cyber_surfer@wildcard.demon.co.uk>
  3. Newsgroups: comp.lang.lisp,comp.lang.c++
  4. Subject: Re: Why garbage collection?
  5. Date: Sat, 03 Feb 96 16:11:27 GMT
  6. Organization: The Wildcard Killer Butterfly Breeding Ground
  7. Message-ID: <823363887snz@wildcard.demon.co.uk>
  8. References: <hbaker-2201961503250001@10.0.2.15> <4eae5s$66p@nz12.rz.uni-karlsruhe.de> <822675271snz@wildcard.demon.co.uk> <DM09G0.MzG.0.macbeth@cogsci.ed.ac.uk>
  9. Reply-To: cyber_surfer@wildcard.demon.co.uk
  10. X-NNTP-Posting-Host: wildcard.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Mail2News-Path: wildcard.demon.co.uk
  13.  
  14. In article <DM09G0.MzG.0.macbeth@cogsci.ed.ac.uk>
  15.            jeff@cogsci.ed.ac.uk "Jeff Dalton" writes:
  16.  
  17. > >> Just look at the technical strength of the argument that GC is not
  18. > >> "in the tradition of the C community"...
  19. > >
  20. > >Yeah, I love it. ;-)
  21. > But it _is_ true that GC is not in the tradition of the C community.
  22. > The argument that it's a "hidden cost" is key here.  C programmers
  23. > feel that they know what everything will do in machine terms, and
  24. > to a fair extent they are right.  (That's so despite a number of
  25. > difficulties and exceptions.)
  26.  
  27. That may be less true these days, with the widespread use of C++, for
  28. the development of Windows software. There's a lot of "hidden cost" in
  29. C++ frameworks. I don't think of these as exceptions, because of the
  30. high popularity of these development tools. It's probably the programmers
  31. who use C, but not large libraries, who are the exceptions.
  32.  
  33. Also, the future, at least for business software, looks more like
  34. being document oriented, rather than application oriented. This will
  35. introduce even more hidden costs.
  36.  
  37. > So when a allocation might do lots of collecting as well (or
  38. > whatever), and you don't really know when, that seems to move
  39. > C into the higher-level / less-in-touch-with-the-machine camp.
  40.  
  41. Exactly. The kind of APIs coming out of MS, Apple, and IBM these days
  42. look more and more high level to me. C is looking less attractive than
  43. C++, but the C++ frameworks that make complex APIs easier to handle
  44. can hide even more - which is both a feature _and_ a problem.
  45.  
  46. > >Mind you, I'm very happy with a mark/compact GC, and I found one
  47. > >in a computer science book, Fundamentals of Data Structures, by
  48. > >E Horowitz and S Sahni. While they're not anti-GC, they refer to
  49. > >Knuth and his belief that specialist languages such as Lisp and
  50. > >SNOBOL are not necessary, and that list and string processing can
  51. > >be done in any language. The languages that seem to have interested
  52. > >them tend to be PL/I, Pascal, and Fortran. Not at all like Lisp.
  53. > Well, surely it's true that list and string processing can be done
  54. > in (almost) any language.  I've done list processing in Basic, for
  55. > instance.  (Good Basics can, of course, do strings, so that's not
  56. > interesting.)
  57.  
  58. I've done it in Forth. In fact, implementing Forth was the first time
  59. I use used linked lists. Since then, I've looked for better ways (i.e.
  60. better languages) for handling lists. The same applies to strings,
  61. as I wrote my first string package in Forth. Hmmm. That was also my
  62. first compiler...
  63.  
  64. > But there's a difference between a language is not necessary
  65. > and saying it's not valuable, or not worth having and using.
  66. > I'm not sure when Knuth stated this belief, but such points had
  67. > a different role in the past then they tend to do today,
  68. > because it was not so widely known that, or how, you could
  69. > do list or string processing.
  70.  
  71. Agreed. The book I quoted from was already dated when I first read it,
  72. in the early 80s. The Knuth quote could, for all I know, be _much_ older.
  73.  
  74. > A similar thing today (or maybe a few years back) might be to
  75. > point out that you could do object-oriented programming in
  76. > (almost) any language.
  77.  
  78. You can even do it in C++. ;-) I've not done any OOP in Forth, but
  79. there's at least one book on the subject. However, I've not read it.
  80. Perhaps you can also do functional programming in C/C++, but I've
  81. not tried it. I _have_ written an experimental Lisp to C compiler,
  82. which I should re-write someday. Anyone who has read a good Lisp
  83. tutorial (W&H, SICP, etc) should be able to write a similar compiler.
  84. -- 
  85. <URL:http://www.demon.co.uk/community/index.html>
  86. <URL:http://www.enrapture.com/cybes/namaste.html>
  87. Po-Yeh-Pao-Lo-Mi | "You can never browse enough."
  88.